package bit_operation;

public class hammingDistance {
    public int hammingDistance(int x, int y) {
        int s = x ^ y;
        int ret = 0;
        while(s > 0) {
            s = s & (s-1);
            ret++;
        }
        return ret;

    }
}
